//package com.enjoy.rocketmq.simple;
//
//import com.enjoy.rocketmq.Util;
//import org.apache.rocketmq.client.consumer.DefaultMQPullConsumer;
//import org.apache.rocketmq.client.consumer.PullResult;
//import org.apache.rocketmq.client.consumer.PullStatus;
//import org.apache.rocketmq.common.message.MessageQueue;
//
//public class PullConsumer {
//    public static void main(String[] args) throws Exception {
//        Util.loadProperties();
//        // 很早之前就被淘汰了，不建议使用
//        DefaultMQPullConsumer consumer = new DefaultMQPullConsumer("please_rename_unique_group_name_4");
//
//        consumer.setNamesrvAddr(System.getProperty("nameserver.addr"));
//
//        MessageQueue mq = new MessageQueue();
//        mq.setQueueId(0);
//        mq.setTopic("TopicTest");
//        mq.setBrokerName("jinrongtong-MacBook-Pro.local");
//
//        long offset = 26;
//        PullResult pullResult = consumer.pull(mq, "*", offset, 32);
//        if (pullResult.getPullStatus().equals(PullStatus.FOUND)) {
//            System.out.printf("%s%n", pullResult.getMsgFoundList());
//            consumer.updateConsumeOffset(mq, pullResult.getNextBeginOffset());
//        }
//
//
//        consumer.shutdown();
//
//    }
//}
